/*
 * @Author: 啊彪
 * @Date: 2021-05-28 15:14:42
 * @LastEditors: 啊彪
 * @LastEditTime: 2021-05-28 19:58:35
 * @Description: 登录日志
 * @FilePath: \boss\src\model\stats\loginLog.model.ts
 */
import mongoose from 'mongoose';

const Schema = mongoose.Schema;
const LoginLogSchema: mongoose.Schema = new Schema({
    roleId: { type: Number, display: '角色ID', index: true },
    nickName: { type: String, display: '角色昵称' },
    serverId: { type: Number, display: '服务器ID' },
    ip: { type: String, display: 'ip地址' },
    loginNum: { type: Number, display: '登录次数', default: 0 },
    loginDate: { type: String, display: '登录时间' },
}).index({ roleId: 1, loginDate: 1 });

const LoginLog = mongoose.model('LoginLog', LoginLogSchema);
export default LoginLog;